<?php
        error_reporting(E_ALL ^ E_NOTICE); 

        //读入
        $Import_TmpFile = 'list.xls'; 
        require_once 'reader.php'; 
        $data = new Spreadsheet_Excel_Reader(); 
        $data->setOutputEncoding('UTF-8'); 
        $data->read($Import_TmpFile); 

        $count=array();
        for($i=0;$i<=20;$i++){
          $count[$i]=0;
        }
     
      for($i=1;$i<=$data->sheets[0]['numRows']; $i++){

      	  	$result=$data->sheets[0]['cells'][$i][3];
            //echo $result."</br>";

            if(strcmp($result,"N")==0){
              $count[1]++;
            }else  if(strcmp($result,"NNE")==0){
              $count[2]++;
            }else  if(strcmp($result,"NE")==0){
              $count[3]++;
            }else if(strcmp($result,"ENE")==0){
              $count[4]++;
            }else if(strcmp($result,"E")==0){
              $count[5]++;
            }else if(strcmp($result,"ESE")==0){
              $count[6]++;
            }else if(strcmp($result,"SE")==0){
              $count[7]++;
            }else if(strcmp($result,"SSE")==0){
              $count[8]++;
            }else if(strcmp($result,"S")==0){
              $count[9]++;
            }else if(strcmp($result,"SSW")==0){
              $count[10]++;
            }else if(strcmp($result,"SW")==0){
              $count[11]++;
            }else if(strcmp($result,"WSW")==0){
              $count[12]++;
            }else if(strcmp($result,"W")==0){
              $count[13]++;
            }else if(strcmp($result,"WNW")==0){
              $count[14]++;
            }else if(strcmp($result,"NW")==0){
              $count[15]++;
            }else if(strcmp($result,"NNW")==0){
              $count[16]++;
            }else if(strcmp($result,"C")==0){
              $count[17]++;
            }
      }
       
         $number=0;
      for($i=1;$i<=17;$i++){
          $number+=$count[$i];
          echo $count[$i]." ";
        }
         echo "</br>";

         for($i=1;$i<=17;$i++){
          echo ((int)($count[$i]/$number*100)/100)." ";
        }

?>